package designPattern.prototype.deepclone;

public class Client {
    public static void main(String[] args) throws CloneNotSupportedException {

        DeepProtoType deepProtoType = new DeepProtoType();
        deepProtoType.deepCloneableTarget = new DeepCloneableTarget("cp","cpdd");
        deepProtoType.name = "cp哒";

//        //方式一实现深拷贝
//        DeepProtoType clone = (DeepProtoType)deepProtoType.clone();
//


        //方式二完成深拷贝
        DeepProtoType clone = (DeepProtoType) deepProtoType.deepClone();

        System.out.println(clone.deepCloneableTarget==deepProtoType.deepCloneableTarget);
        System.out.println(clone.deepCloneableTarget);
        System.out.println(deepProtoType.deepCloneableTarget);
    }
}
